<!DOCTYPE html>
<html>
<head>
    <title>用户注册</title>
    <meta charset="utf-8">
    <link href="/stylesheets/bootstrap.min.css" rel="stylesheet" media="screen">
    <script src="/javascripts/jquery-2.1.1.min.js" type="text/javascript"></script>
    <script src="/javascripts/bootstrap.min.js" type="text/javascript"></script>
    <style type="text/css">
        .panel-body{
            padding: 30px 50px 0 50px;
        }
        .form-group{
            margin-bottom: 35px;
        }
        .panel-title{
            font-size: 24px;
            font-weight: bold;
        }
    </style>
    <script type="text/javascript">
        function register(){
            var name = $('#username').val(),
                    password = $('#password').val();
            var data = { "uname": name, upwd:password};
            $.ajax({
                url:'/register',
                type:'POST',
                data:data,
                success:function(data,status){
                    if(status == 'success'){
                        location.href='login';
                    }
                },
                error:function(data,err){
                    location.href='register';
                }
            });
        }
    </script>
</head>
<body>
<div class="container web-body" style="margin-top:100px;width: 980px;">
    <%- message %>
    <div class="row">
        <div class="col-lg-6 col-lg-offset-3">
            <div class="panel panel-default">
                <div class="panel-heading" style="height: 50px;">
                    <div class="panel-title" style="text-align: left">用户注册</div>
                </div>
                <div class="panel-body">
                    <form action="#" class="form-horizontal" role="form" method="post" >
                        <div class="form-group">
                            <input id="username" type="text" class="form-control" name="username" placeholder="用户名" />
                        </div>
                        <div class="form-group">
                            <input id="password" type="password" class="form-control" name="password"  placeholder="密码" />
                        </div>
                        <div class="form-group">
                            <input id="confirmpwd" type="password" class="form-control" name="confirmpwd" placeholder="确认密码" />
                        </div>
                        <div class="form-group">
                            <input type="button" class="btn btn-success btn-block" onclick="register()" value="注 册" />
                            <a href="login" class="btn btn-primary" style="float: right;margin-top: 20px;">登 陆</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>


